<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/salejihui/css/pagination.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/salejihui/css/cssreset.css">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/salejihui/css/style2.css">

<style>
input {
	line-height: 30px;
	text-align: left;
	float: none;
	color: #616264;
}
  label.error{
       font-size:13px; 
		margin-left:8px;
		color: orangered;
        }
</style>




</head>
<body>
	<div class="bigbox2">
		<nav class="nav2">
			<span class="scolor"></span>
			<ul>
    				<li><a href="../page/originalIndex.jsp"><p class="mline"><span class="smallicon"></span><span class="navtxt">首 页</span></p></a></li>
    				<li><a href="../client/findByIndex.action"><p class="mline"><span class="smallicon one1" ></span><span class="navtxt" >客 户</span></p></a></li>
    				<li><a href="../sale/findSale.action" id="sline"><p class="mline"><span class="smallicon one2" id="current21"></span><span class="navtxt" id="current2">销 售 机 会</span></p></a></li>
    				<li><a href="../contact/page.action"><p class="mline"><span class="smallicon one3" ></span><span class="navtxt">联 系 人</span></p></a></li>
    				<li><a href="../contract/findByAlls.action"><p class="mline"><span class="smallicon one4"></span><span class="navtxt">合 同</span></p></a></li>
    				<li class="shenpi"><a href="../page/pacts.jsp"><p class="mline"><span class="smallicon one8"></span><span class="navtxt">合 同 审 批</span></p></a></li>
    				<c:if test="${sessionScope.backstage == 1}">
   						<li><a href="../staff/selectTree.action"><p class="mline"><span class="smallicon one5"></span><span class="navtxt">后 台 管 理</span></p></a></li>
    				</c:if>
    			</ul>
		</nav>
		<div class="showbox3">
			<p class="xtitle">销 售 机 会 详 情</p>
			<span class="boxone">
				<div class="above">
					<img
						src="${pageContext.request.contextPath}/salejihui/images/icon (31).png"
						alt="" class="po"> <span class="salename">
						&nbsp;销售机会所有人：${list.staff} </span> <span class="open"
						style="float: right;margin-right: 29%;width: 0px;"> <span
						class="opennew" id="biu">编 辑</span>

					</span>
				</div>
				<ul class="sun">
					<li><span class="sone">机会名称</span><br> <span class="stwo">${list.sale.saleOpportunityName}</span>
					</li>
					<li><span class="sone">客户名称</span><br> <span class="stwo">${list.client}</span>
					</li>
					<li><span class="sone">机会类型</span><br> <span class="stwo">${list.sale.saleOpportunitytype}</span>
					</li>
					<li><span class="sone">销售金额</span><br> <span class="stwo">${list.sale.saleMoney}</span>
					</li>
					<li><span class="sone">结单日期</span><br> <span class="stwo"><fmt:formatDate
								value="${list.sale.saleCloseDate}" pattern="yy-MM-dd" /></span></li>
					<li id="xiaoshou"><span class="sone">销售阶段</span><br> <span
						class="stwo" id="xiaoshoujieduan">${list.salestage}</span></li>
				</ul>
			</span>
			<div class="b-box"></div>
		</div>
		<div id="cover1">
			<div id="cover-bg1"></div>
			<div id="cover-content1">
				<form
					action="${pageContext.request.contextPath}/sale/updateSale.action"
					method="post" id="insertform">
					<h4>
						机 会 编 辑<span class="close"></span>
					</h4>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">机会所有人</span> <span class="xsicon"><img
							src="${pageContext.request.contextPath}/salejihui/images/head.png"
							alt="" class="kkk" style="top:0px">&nbsp;</span> <span
							class="name" style="bottom:12px;left: 42%;">${list.staff}</span>


						<input type="hidden" class="name" id="staffId" name="staffId"
							value="${list.sale.staffId}"> <input type="hidden"
							class="name" id="saleId" name="saleId"
							value="${list.sale.saleId}"> <input type="hidden"
							class="name" id="clientId" name="clientId"
							value="${list.sale.clientId}">


					</p>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">机 会 名 称</span> 
						<input type="text"
							placeholder="&nbsp;&nbsp;请输入机会名称 " class="shurukuang"
							name="saleOpportunityName"
							value="${list.sale.saleOpportunityName}">
					</p>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">客 户 名 称</span> <span class="name"
							style="bottom:12px;left:38%;">${list.client}</span>


					</p>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">销 售 金 额</span> <input type="text"
							placeholder="&nbsp;&nbsp;请输入销售金额 " class="shurukuang"
							name="saleMoney" value="${list.sale.saleMoney}">
					</p>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">销 售 阶 段</span> <select id="one"
							class="shenfenselect shenfenselect3" name="salestageId">
							<c:forEach var="salestages" items="${salestages}">
								<option value="${salestages.saleStageId}">${salestages.saleStageName}</option>
							</c:forEach>

						</select>


					</p>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">结 单 日 期</span> <input type="text"
							class="shurukuang Wdate" style="height: 30px;1px solid #bfbfbf;"
							placeholder="&nbsp;&nbsp;请输入结单日期 "
							value="<fmt:formatDate value='${list.sale.saleCloseDate}' pattern='yy-MM-dd'/>"
							name="saleCloseDate"
							onfocus="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd',readOnly:true})">
					</p>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">备
							注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <input
							type="text" placeholder="&nbsp;&nbsp;请输入备注 "
							value="${list.sale.saleRemark}" class="shurukuang"
							name="saleRemark">
					</p>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">所 属 部 门</span> <select
							class="shenfenselect shenfenselect3" name="departmentId">
							<c:forEach var="departments" items="${departments}">
								<option value="${departments.department_id}"
									>${departments.department_name}</option>
							</c:forEach>

						</select>
					</p>

					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">机 会 类 型</span> <select
							class="shenfenselect shenfenselect3" name="saleOpportunitytype">
							<option value="新机会类型"
							>新机会类型</option>
							<option value="旧机会类型"
							>旧机会类型</option>


						</select>
					</p>
					<p class="main" style="padding-right: 0px;">
						<span class="leftmain">机 会 来 源</span> <select
							class="shenfenselect shenfenselect3" name="sourceId">
							<c:forEach var="sources" items="${sources}">
								<option value="${sources.sourceId}"
									>${sources.sourceName}</option>
							</c:forEach>

						</select>
					</p>

					<p class="main" style="text-align: center;padding-left: 0px;">

						<button class="btn1 btn2" type="submit">保存</button>
						<button class="btn1 btn3" type="button" onclick="quxiao()">取消</button>
					</p>
				</form>
			</div>
		</div>

		<div class="showbox3 showbox4">
			<div class="boxtwo">
				<c:if test="${list.sale.saleSingleStatut==1}">
					<div class="hhh">已输单 输单原因：${list.sale.saleSinglecause}</div>
				</c:if>
				
				<ul class="boxtwoul">
				<c:if test="${list.sale.saleSingleStatut==0}">
					<c:forEach items="${salestages}" var="salestages">
						<li><span>${salestages.saleStageName}</span></li>
						<!--<li><span>需求确定</span></li>
	    		  		<li><span>方案/报价</span></li>
	    		  		<li><span>谈判审核</span></li>
	    		  		<li><span>赢单</span></li>-->
					</c:forEach>
					</c:if>
					<c:if test="${list.sale.saleSingleStatut==0}">
						<li><a href="#" class="shudan">输单</a></li>
					</c:if>
					<c:if test="${list.sale.saleSingleStatut==1}">
						<li><button type="button" style="width:100px;" class="chongqi"
								onclick="chongqis()">重新启动</button></li>
					</c:if>

				</ul>
				<div class="boxthree">
					<span class="threenav"> <a class="fg"
						style="font-size: 20px;" id="dongtai">动态</a> 
						<a  class="bluechange" style="font-size: 20px;" id="ziliao">资料</a>
					</span>
					<div class="formdan" style="display: none;padding-bottom: 40px;"
						id="jibenxinxi">
						<p>基本信息</p>
						<ul class="basictxt">
							<li><span class="crazy">销售机会所有人</span> <span class="crazy2">${list.staff}</span>
							</li>
							<li><span class="crazy">机会名称</span> <span class="crazy2">${list.sale.saleOpportunityName}</span>
							</li>
							<li><span class="crazy">客户名称</span> <span class="crazy2">${list.client}</span>
							</li>

							<li><span class="crazy">机会类型</span> <span class="crazy2">${list.sale.saleOpportunitytype}</span>
							</li>
							<li><span class="crazy">销售金额</span> <span class="crazy2">${list.sale.saleMoney}</span>
							</li>
							<li><span class="crazy">销售阶段</span> <span class="crazy2">${list.salestage}</span>
							</li>

							<li><span class="crazy">结单日期</span> <span class="crazy2"><fmt:formatDate value='${list.sale.saleCloseDate}' pattern='yy-MM-dd'/></span>
							</li>
							<li><span class="crazy">机会来源</span> <span class="crazy2">${list.sources}</span>
							</li>
							<li><span class="crazy">所属部门</span> <span class="crazy2">${list.department}</span>
							</li>
							<li><span class="crazy">备注</span> <span class="crazy2">${list.sale.saleRemark}</span>
							</li>
						</ul>

					</div>

					<div class="formdan" id="jiluleixing">
						<form
							action=""
							method="post" id="salestrack">


							<p style="color: #8fa1b2;padding-left: 1px;margin-top: 20px;">销售机会动态跟进</p>
							<select id="onesssss" class="shenfenselect shenfenselect3"
								style="margin-left: 1px" name="recordId">
								<c:forEach var="records" items="${records}">
									<option value="${records.recordId}">${records.recordName}</option>
								</c:forEach>

								<!--<p style="color: #8fa1b2;padding-left: 1px;padding-bottom: 0px;">客户反馈</p>-->
								<textarea class="fankui" id="fankui" name="saletrackFeedback"
									placeholder="请输入客户反馈信息"
									style="border: 1px solid #cfdae5;height: 80px;padding:5px 5px 5px 10px;color: #8fa1b2;"></textarea>

								<!--<p style="color: #8fa1b2;padding-left: 1px;padding-bottom: 0px;">重要情况说明</p>-->
								<textarea class="fankui1" id="shuoming"
									name="saletrackStatusstatement" placeholder="请输入重要情况说明"
									style="border: 1px solid #cfdae5;height: 80px;padding:5px 5px 5px 10px;color: #8fa1b2;"></textarea>
								<!--<p style="color: #8fa1b2;padding-left: 1px;padding-bottom: 0px;">情况跟踪描述</p>-->
								<textarea class="fankui2" id="miaosu" name="saletrackDescrip"
									placeholder="请输入情况跟踪描述"
									style="border: 1px solid #cfdae5;height: 80px;padding:5px 5px 5px 10px;color: #8fa1b2;"></textarea>
								<p class="ee" style="margin-top: 20px;">
									<button type="submit" class="sm" 
										style="width: 70px;margin-right: 15px;">发表</button>
								</p>
						</form>

						<div class="qingkong">
							<c:forEach items="${saletrack}" var="list">
								<div class="shijian"
									style="width: 100%;height: 30px;line-height: 32px;color:#8fa1b2;padding: 0px 14px;">
									<fmt:formatDate value='${list.saleTrack.saletrackDate}' pattern='yyyy-MM-dd hh:mm:ss' />
								</div>
								<ul class="liuyan"
									style="padding-top: 0px;margin-top: 0px;padding-bottom: 10px;">
									<!--<li class="liuyanp">
	    		  					<span class="smallpic"><img src="${pageContext.request.contextPath}/salejihui/images/icon (29).png" alt="" class="smallpic2">李欢<span style="color:#adadae;margin-left:15px">电话联系了销售机会</span></span>
	    		  					<span class="deleting">删 除<br></span>
	    		  				</li>-->
									<li class="liuyanp" style="background: none;margin-top: 0px;">
										<span class="smallpic" style="margin-top: 20px;"><img
											src="${pageContext.request.contextPath}/salejihui/images/icon (29).png"
											alt="" class="smallpic2">${list.staff}<span
											style="color:#adadae;margin-left:15px">${list.record}联系了销售机会</span></span> 
											<span class="deleting" style="margin-top: 10px;float:right;margin-right: 10px;" onclick="del(${list.saleTrack.saletrackId})">删 除<br></span><br>
										<span class="liutxt">事件类型:${list.record}</span><br> <span
										class="liutxt">客户反馈:${list.saleTrack.saletrackFeedback}</span><br>
										<span class="liutxt">重要情况说明:${list.saleTrack.saletrackStatusstatement}</span><br>
										<span class="liutxt">情况跟踪描述:${list.saleTrack.saletrackDescrip}</span><br>
									</li>
								</ul>
							</c:forEach>
						</div>

						<!-- <p class="ee"> <input type="submit" value="回复" class="sm"></p> -->
						<!--<p><img src="${pageContext.request.contextPath}/salejihui/images/icon (28).png" alt="" class="shui">2017-07-20 15:02 <span style="color:#1fd4fb;">李欢</span> 将销售机会：<span style="color:#1fd4fb;">财务软件 </span>销售阶段 变为需求确定</p>
	    		  			<p><img src="${pageContext.request.contextPath}/salejihui/images/icon (28).png" alt="" class="shui">2017-07-20 15:02 <span style="color:#1fd4fb;">李欢</span> 将销售机会：<span style="color:#1fd4fb;">财务软件 </span>销售阶段 变为需求确定</p>
	    		  			<p><img src="${pageContext.request.contextPath}/salejihui/images/icon (28).png" alt="" class="shui">2017-07-20 15:02 <span style="color:#1fd4fb;">李欢</span> 将销售机会：<span style="color:#1fd4fb;">财务软件 </span>销售阶段 变为需求确定</p>
	    		  			<p><img src="${pageContext.request.contextPath}/salejihui/images/icon (28).png" alt="" class="shui">2017-07-20 15:02 <span style="color:#1fd4fb;">李欢</span> 将销售机会：<span style="color:#1fd4fb;">财务软件 </span>销售阶段 变为需求确定</p>
	    		  			<p><img src="${pageContext.request.contextPath}/salejihui/images/icon (28).png" alt="" class="shui">2017-07-20 15:02 <span style="color:#1fd4fb;">李欢</span> 将销售机会：<span style="color:#1fd4fb;">财务软件 </span>销售阶段 变为需求确定</p>
	    		  			<p><img src="${pageContext.request.contextPath}/salejihui/images/icon (28).png" alt="" class="shui">2017-07-20 15:02 <span style="color:#1fd4fb;">李欢</span> 将销售机会：<span style="color:#1fd4fb;">财务软件 </span>销售阶段 变为需求确定</p>-->
					</div>
					<!--<div class="M-box" style="margin-left:35%;margin-top:20px;"></div>-->


				</div>
			</div>
		</div>
	</div>



	<div id="cover">
		<div id="cover-bg"></div>

		<form
			action="${pageContext.request.contextPath}/sale/updateSale.action"
			method="post" id="cover-content">
			<h4>
				输单<span class="close"></span>
			</h4>
			<p class="main">
				<span class="leftmain">是否将良好的销售阶段调整为输单？</span>
			</p>
			<input type="hidden" name="saleSingleStatut" value="1" /> <input
				type="hidden" class="name" id="saleId" name="saleId"
				value="${list.sale.saleId}">
			<p class="main">
				<span class="leftmain">请选择输单理由</span> <select id="reason"
					class="shenfenselect" name="saleSinglecause">
					<option value="价格原因">价格原因</option>
					<option value="客户原因">客户原因</option>
					<option value="质量原因">质量原因</option>
					<option value="其他关系原因">其他关系原因</option>

				</select>
			</p>
			<p class="main mmain">
				<span class="leftmain">请输入输单描述</span>
				<textarea id="" cols="30" rows="10" class="txtara"
					name="saleSingledescription"></textarea>
			</p>
			<p class="main">
				<button class="btn1 btn3" type="button" onclick="quxiao()">取消</button>
				<button type="submit" class="btn1 btn2 btn4" id="btn4">输单</button>

			</p>
		</form>

	</div>

	<script
		src="${pageContext.request.contextPath}/salejihui/js/jquery-1.8.3.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/salejihui/js/jquery.pagination.js"></script>
	<script
		src="${pageContext.request.contextPath}/salejihui/My97DatePicker/WdatePicker.js"></script>
	<script
		src="${pageContext.request.contextPath}/salejihui/js/jquery.validate.min.js"></script>
	<script
		src="${pageContext.request.contextPath}/salejihui/js/messages_zh.min.js"></script>
	<!--  <script>
            $('.M-box').pagination({
            pageCount: ${PageCount},//总页数
            current: ${PageNum},//当前页码
            callback:function(api){
                var pageNum=api.getCurrent();
                $.ajax({  
                    type : "POST",  
                    url : "<%=basePath%>staff/findStaff.action",//路径  
                    data : {  
                        pageNum : api.getCurrent()  
                    },
                    success : function(data) {
                        var number=data[0].number;//总页数
                        api.setPageCount(number);//动态修改总页数为20页
                        var pageNum=data[0].pageNum;
                          var text="";
                            $('.trs').remove();
                            for(var i=0;i<data[0].list.length;i++){
                                 
                                     text=$('<li><h6 class="sbox1"><span>'+'审批提交人：李华'+'</span><span>'+'类型：请假'+'</span><span>'+'提交日期：2017-7-18'+'</span></h6><h5 class="ssbox1">'+'审批正文：发发发的发沙发沙发沙发发多撒大所大所大所大所大所大所大所大所大所大所大所多发发发的发沙发沙发沙发发多撒大所大所大所大所大所大所大所大所大所大所大所多'+'<a href="#" class="more">'+'查看更多 > '+'</a></h5></li>');
                                    $('.apprcontent ul').append(text);
                                }
                    }
                });  
            }
        },function(api){
            var pageNum;
            $.ajax({  
                type : "POST",  
                url : "<%=basePath%>staff/findStaff.action",//路径  
                data : {  
                    pageNum : api.getCurrent()   
                },
                success : function(data) {           
                    var number=data[0].number;//总页数
                    api.setPageCount(number);//动态修改总页数为20页
                    var pageNum=data[0].pageNum;
                      var dat=[];
                        for(var i=0;i<data[0].list.length;i++){
                            dat.push(data[0].list);
                            var text=$('<li><h6 class="sbox1"><span>'+'审批提交人：李华'+'</span><span>'+'类型：请假'+'</span><span>'+'提交日期：2017-7-18'+'</span></h6><h5 class="ssbox1">'+'审批正文：发发发的发沙发沙发沙发发多撒大所大所大所大所大所大所大所大所大所大所大所多发发发的发沙发沙发沙发发多撒大所大所大所大所大所大所大所大所大所大所大所多'+'<a href="#" class="more">'+'查看更多 > '+'</a></h5></li>');
                            $('.apprcontent ul').append(text);
                        }
                                
                }
            });  
        });
              
         
             }
        </script> -->
	<script>
        function chongqis(){
		var statu=0;
			var url="${pageContext.request.contextPath}/sale/updateSale1.action";
					var pam={
							saleSingleStatut:statu,
							saleId:$("#saleId").val(),
							staffId:$("#staffId").val()
							};
					$.post(url,pam,function(data){	
							location="${pageContext.request.contextPath}/sale/findSaleId.action?pageSize=4&pageNum=1&id="+data;
				}); 
		}
             $('.M-box').pagination({
                    callback:function(api){
                        $('.now').text(api.getCurrent());
                    }
                },function(api){
                    $('.now').text(api.getCurrent());
                });
         </script>
</body>
<script>
		function quxiao(){
			$("#cover").removeAttr("style");
			        $("#cover-content").removeAttr("style");
			         $("#cover1").removeAttr("style");
			        $("#cover-content1").removeAttr("style");
			        $('body').css("overflow","scroll");
		}
		
		function del(id){
			
			/*$("span[class='deleting']").each(function(event) {
		          			$(this).parent().parent().prev().remove();
        						$(this).parent().parent().remove();
        					});*/
        	var saleId=$("#saleId").val();
			var url="${pageContext.request.contextPath}/SaleTrack/deleteSaletrack.action";
					var pam={
							saletrackId:id,
							saleId:saleId
						};
					$.getJSON(url,pam,function(data){
						alert("删除成功");
						$(".qingkong").empty();
						$(".shijian").empty();
						$(".liuyan").empty();	
						$.each(data,function(i,zhuijia){
							var objDiv="<div class='shijian' style='width: 100%;height: 30px;line-height: 32px;color:#8fa1b2;padding: 0px 14px;'>"+zhuijia.Date+"</div><ul class='liuyan' style='padding-top: 0px;margin-top: 0px;padding-bottom: 10px;'><li class='liuyanp' style='background: none;margin-top: 0px;'><span class='smallpic' style='margin-top: 20px;'><img src='${pageContext.request.contextPath}/salejihui/images/icon (29).png' class='smallpic2'>"+zhuijia.staff+"<span style='color:#adadae;margin-left:15px'>"+zhuijia.record+"联系了销售机会</span></span><span class='deleting' style='margin-top: 10px;float: right;margin-right: 10px;' onclick='del("+zhuijia.saleTrack.saletrackId+")'>删 除<br></span><br>"
	    		  			+"<span class='liutxt'>事件类型:"+zhuijia.record+"</span><br><span class='liutxt'>客户反馈:"+zhuijia.saleTrack.saletrackFeedback+"</span><br><span class='liutxt'>重要情况说明:"+zhuijia.saleTrack.saletrackStatusstatement+"</span><br><span class='liutxt'>情况跟踪描述:"+zhuijia.saleTrack.saletrackDescrip+"</span><br></li></ul>";
							$(".qingkong").append(objDiv);
						});
						
				}); 
			    }
		
		
	
	
				$(function(){
				$("#salestrack").validate({  
					onsubmit:true,// 是否在提交是验证  
					onfocusout:false,// 是否在获取焦点时验证  
					onkeyup :false,// 是否在敲击键盘时验证  
					  
					rules: {  
						saletrackFeedback:{
                        required:true
                    	},
					},  
					messages:{  
						saletrackFeedback:{
                        required:"客户反馈不能为空"
                    	},  
					},  
					submitHandler: function(form) {  //通过之后回调  
					     var jilu=$("#onesssss").find("option:selected").attr("value");
		 
						var url="${pageContext.request.contextPath}/SaleTrack/insertSaleTrack.action";
						var pam={
							saletrackFeedback:$("#fankui").val(),
							recordId:jilu,
							saletrackStatusstatement:$("#shuoming").val(),
							saletrackDescrip:$("#miaosu").val(),
							saleId:$("#saleId").val(),
							staffId:$("#staffId").val()
							};
					
						$.getJSON(url,pam,function(data){
						if(data.length!=0){ 
						$(".qingkong").empty();
						$(".shijian").empty();
						$(".liuyan").empty();	
						$.each(data,function(i,zhuijia){
							var objDiv="<div class='shijian' style='width: 100%;height: 30px;line-height: 32px;color:#8fa1b2;padding: 0px 14px;'>"+zhuijia.Date+"</div><ul class='liuyan' style='padding-top: 0px;margin-top: 0px;padding-bottom: 10px;'><li class='liuyanp' style='background: none;margin-top: 0px;'><span class='smallpic' style='margin-top: 20px;'><img src='${pageContext.request.contextPath}/salejihui/images/icon (29).png' class='smallpic2'>"+zhuijia.staff+"<span style='color:#adadae;margin-left:15px'>"+zhuijia.record+"联系了销售机会</span></span><span class='deleting' style='margin-top: 10px;float: right;margin-right: 10px;' onclick='del("+zhuijia.saleTrack.saletrackId+")'>删 除<br></span><br>"
	    		  			+"<span class='liutxt'>事件类型:"+zhuijia.record+"</span><br><span class='liutxt'>客户反馈:"+zhuijia.saleTrack.saletrackFeedback+"</span><br><span class='liutxt'>重要情况说明:"+zhuijia.saleTrack.saletrackStatusstatement+"</span><br><span class='liutxt'>情况跟踪描述:"+zhuijia.saleTrack.saletrackDescrip+"</span><br></li></ul>";
							$(".qingkong").append(objDiv);
						
						});
							//这个对象名自己起
							$("#fankui").val("");
							$("#shuoming").val("");
							$("#miaosu").val("")
						}
						});  
						    },  
						    invalidHandler: function(form, validator) {  //不通过回调  
						    	return false;  
						    }  
						});
				
				
				/*jQuery.validator.addMethod("stringCheck", function(value, element) {
				  var length = value.length;  
    var regName = /[^\u4e00-\u9fa5]/g;  
    return this.optional(element) || !regName.test( value ); 
				}, "机会名称为中文"); */
		         var validate = $("#insertform").validate({
                debug: true, //调试模式取消submit的默认提交功能   
                //errorClass: "label.error", //默认为错误的样式类为：error   
                focusInvalid: false, //当为false时，验证无效时，没有焦点响应  
                onkeyup: false,   
                submitHandler: function(form){   //表单提交句柄,为一回调函数，带一个参数：form   
                       
                    form.submit();   //提交表单   
                },   

                rules:{
                    saleOpportunityName:{
                        required:true
                    },
                    clientId:{
                        required:true
                    },
                    saleMoney:{
                        required:true,
                        number:true
                        
                    },
                     salestageId:{
                        required:true
                    },
                    saleCloseDate:{
                        required:true
                    },
                     departmentId:{
                        required:true
                    },
                    saleOpportunitytype:{
                        required:true
                    },
                    sourceId:{
                        required:true
                        
                    }                   
                },
                messages:{
                    saleOpportunityName:{
                        required:"机会名不能为空"
                    },
                    clientId:{
                        required:"客户不能为空"
                        
                    },
                    saleMoney:{
                        required: "请输入金额",
                         number:"请输入正确的金额"
                    },
                    salestageId:{
                        required:"必填"
                    }, 
                     saleCloseDate:{
                        required:"请输入时间"
                    },
                     departmentId:{
                        required:"必填"
                    },
                     saleOpportunitytype:{
                        required:"必填"
                    },
                     sourceId:{
                        required:"必填"
                    },
                }
                          
            });
				
				
				//点击资料和动态换不同内容
				$("#dongtai").click(function(){
			$("#jiluleixing").show();
			$("#jibenxinxi").hide();
			$(".M-box").show();
			$(this).addClass("fg");
			$("#ziliao").css({color: "",
background: ""});
			
		});
		
		$("#ziliao").click(function(){
			$("#jiluleixing").hide();
			$("#jibenxinxi").show();
			$(".M-box").hide();
			$(this).css({color: "#fff",background: "#1fd4fb"});
			$("#dongtai").removeClass("fg");
			$('.threenav a').css('margin-left','0px');
			$('.threenav .bluechange').css('margin-left','-6px')
			
		});	
				
				//获取阶段值
				var xiaoshoujieduan=$("#xiaoshoujieduan").html();
				$(".boxtwoul").find("li").each(function(){
					if($(this).text()==xiaoshoujieduan){
					$(this).attr("id","kin");
					}
				})
				$(".shudan").click(function(e){
			        e.preventDefault();
			        $('body').css("overflow","hidden");
			        $("#cover").css("display","block");
			        $("#cover").animate({
			            width: "100%",
			            height: "1800px",
			            top: "0",
			            left: "0"
			        },10);
			    });
			    $("#biu").click(function(e){
			    
			    
			        e.preventDefault();
			        $('body').css("overflow","hidden");
			        $("#cover1").css("display","block");
			        $("#cover1").animate({
			            width: "100%",
			            height: "1800px",
			            top: "0",
			            left: "0"
			        },10);
			    });
			    $(".close").click(function(){
			        $("#cover").removeAttr("style");
			        $("#cover-content").removeAttr("style");
			         $("#cover1").removeAttr("style");
			        $("#cover-content1").removeAttr("style");
			        $('body').css("overflow","scroll");
			    });
			   
			    });
		   </script>
</html>
<!-- for(var i in array){
   if(i==0){

   }
   if()

	 array[0]=
   }
} -->